from fastapi import APIRouter
from ...http import *
from src.celery.ai_image import start_ai_img


router = APIRouter()

# http://127.0.0.1:8000/api/v1/ks/like
@router.get("/like")
async def LikeVideo(pcursor: str = ''):
    """
      获取账号下点过赞的所有视频

      - **pcursor**: 下一页的页标
      \f
      :param item: User input.
      """
    res = await http.post(
        { 'page': "profile", 'pcursor': pcursor }, 
        httpConfig.visionProfileLikePhotoList
    )

    # feeds = res['feeds']

    # 处理原始数据，构造视频 & 图片
    # imgSourceUrl = []
    # for index, item in enumerate(feeds):
    #     imgSourceUrl.append(item['photo']['coverUrl'])
        # imgSourceUrl.append({ 
        #   'id': item['photo']['id'],
        #   'imgSrc': item['photo']['coverUrl'], 
        #   'videoSrc': item['photo']['photoUrl'] 
        # })

    # task = start_ai_img.delay(keyWord,imgSourceUrl)
        
    return res